<?php include('page_header.php')?>
<!--script type="text/javascript" src="../kindeditor/kindeditor.js"></script--> 
<script type="text/javascript">
//KE.show({id : 'album_content'});
var tID=0;
function showtabs(ID){
    var tTabTitle=document.getElementById("tabtitle"+tID);
    var tTabs=document.getElementById("tabs"+tID);
    var TabTitle=document.getElementById("tabtitle"+ID);
    var Tabs=document.getElementById("tabs"+ID);
    if(ID!=tID){
        tTabTitle.className='title1';
        TabTitle.className='title2';
        tTabs.style.display='none';
        Tabs.style.display='';
        tID=ID;
    }
}	
</script>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
  <tbody>
  <tr align=middle> 
    <td width="100" style="cursor:pointer" height="25" class=title2 id=tabtitle0 onclick=showtabs(0)>相册信息</td>

    <td width="100" style="cursor:pointer" class=title1 id=tabtitle1 onclick=showtabs(1)>图片信息</td>
    <td>&nbsp;</td>
  </tr></tbody>
</table>
<form name="myform" method="post" action="?c=album&m=insert">
    <table width="100%" cellpadding="2" cellspacing="1" class="tableborder">
        <tbody id=tabs0 style="DISPLAY:">
            <tr>
                <th colspan=2>基本信息</th>
            </tr>
            <tr>
                <td width="60" align="left" class="tablerow">标题<font color="#FF0000">*</font></td>
                <td class="tablerow"><input name="album_name" type="text" value="" size="65"></td>
            </tr>
            <tr>
                <td align="left" class="tablerow">所属类别<font color="#FF0000">*</font></td>
                <td align="left" class="tablerow">
                	<select name="cat_id" style="width: 10em">
                    	<option value="0">请选择...</option>
                    	<?php foreach($categories as $i => $catgory):?>
                        <option value="<?= $catgory['cat_id']?>" <?php if($catgory['cat_id'] === isset($_GET['cat_id'])?$_GET['cat_id']:0):?>selected<?php endif;?>><?= $catgory['cat_name']?></option>
                        <?php endforeach;?>
                	</select>
                </td>
            </tr>
            <tr>
                <td align="left" class="tablerow">来源</td>
                <td align="left" class="tablerow"><input name="album_from" type="text" value="" size="30"></td>
            </tr>
            <!--tr>
                <td align="left" class="tablerow">内容</td>
                <td class="tablerow"><textarea name="album_content" cols="100" rows="20" id="album_content"></textarea></td>
            </tr-->
            <tr>
                <td align="left" class="tablerow">关键字</td>
                <td class="tablerow"><input name="album_keywords" type="text" value="" size="40"></td>
            </tr>
            <tr>
                <td align="left" class="tablerow">描述</td>
                <td class="tablerow"><textarea name="album_description" id="album_description" cols="45" rows="5"></textarea></td>
            </tr>
        </tbody>
        <tbody id=tabs1 style="DISPLAY:none">
          <tr> 
            <th colspan=2>地址信息</th>    
          </tr>
          <tr> 
            <td width="60" align="left" class="tablerow">原有图片</td>
            <td class="tablerow">&nbsp;</td>
          </tr>
          <tr> 
            <td align="left" class="tablerow">添加图片</td>
            <td class="tablerow">
            	<div style="width: 180px; height: 18px; border: solid 1px #7FAAFF; background-color: #C5D9FF; padding: 2px;">
                	<span id="spanButtonPlaceholder"></span>
                </div>
            </td>    
          </tr>
          <tr> 
            <td align="left" class="tablerow">&nbsp;</td>
            <td class="tablerow">
            	<div id="divFileProgressContainer" style="height: 75px;"></div>
				<div id="thumbnails"></div>
            </td>
          </tr>
        </tbody>
        <tbody>
            <tr>
                <td height="25" colspan="2" bgcolor="#E1E1E1"><input name="" type="submit" value=" 提 交 "></td>
            </tr>
        </tbody>
    </table>
</form>
<?php include('page_footer.php')?>
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
var swfu;
window.onload = function () {
	swfu = new SWFUpload({
		// Backend Settings
		upload_url: "upload.php",
		post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},

		// File Upload Settings
		file_size_limit : "2 MB",	// 2MB
		file_types : "*.jpg; *.jpeg; *.gif; *.png",
		file_types_description : "JPG Images",
		file_upload_limit : "0",

		// Event Handler Settings - these functions as defined in Handlers.js
		//  The handlers are not part of SWFUpload but are part of my website and control how
		//  my website reacts to the SWFUpload events.
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "images/SmallSpyGlassWithTransperancy_17x18.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 180,
		button_height: 18,
		button_text : '<span class="button">Select Images <span class="buttonSmall">(2 MB Max)</span></span>',
		button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
		button_text_top_padding: 0,
		button_text_left_padding: 18,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,
		
		// Flash Settings
		flash_url : "../swfupload/swfupload.swf",

		custom_settings : {
			upload_target : "divFileProgressContainer"
		},
		
		// Debug Settings
		debug: false
	});
};
</script>